<header class="page-header">
    <button class="menu-button js-menu-button" {{action "toggleGlobalMobileNav"}}><span class="sr-only">菜单</span></button>
    <h2 class="page-title">编辑器</h2>
</header>

<div class="page-content">
    <header>
        <section class="box entry-title">
            {{gh-trim-focus-input type="text" id="entry-title" placeholder="博文标题" value=model.titleScratch
            tabindex="1" focus=shouldFocusTitle}}
        </section>
    </header>

    <section {{bind-attr class=":entry-markdown :js-entry-markdown isPreview::active"}}>
        <header {{action "togglePreview" false}} class="floatingheader">
            <small>MARKDOWN 标签</small>
            <a class="markdown-help" href="" {{action "openModal" "markdown"}}><span class="hidden">Markdown使用帮助</span></a>
        </header>
        <section id="entry-markdown-content" class="entry-markdown-content">
            {{gh-codemirror value=model.scratch scrollInfo=view.markdownScrollInfo
            setCodeMirror="setCodeMirror" openModal="openModal" typingPause="autoSave"
            focus=shouldFocusEditor focusCursorAtEnd=model.isDirty onFocusIn="autoSaveNew"}}
        </section>
    </section>

    <section {{bind-attr class=":entry-preview :js-entry-preview isPreview:active"}}>
        <header {{action "togglePreview" true}} class="floatingheader">
            <small>预览 <span class="entry-word-count js-entry-word-count">{{gh-count-words model.scratch}}</span></small>
        </header>
        <section class="entry-preview-content js-entry-preview-content">
            {{gh-markdown classNames="rendered-markdown js-rendered-markdown"
            markdown=model.scratch scrollPosition=view.scrollPosition
            uploadStarted="disableCodeMirror" uploadFinished="enableCodeMirror" uploadSuccess="handleImgUpload"}}
        </section>
    </section>

    {{partial "publish-bar"}}

</div>
